import request from '@/utils/request'

const api_name = '/sx/user'

export default {
    login(data) {
        return request({
            url: `${api_name}/login`,
            method: 'post',
            data: data
        })
    },
    registration(data) {
        return request({
            url: `${api_name}/registration`,
            method: 'post',
            data: data
        })
    },

    updatePasswod(data) {
        return request({
            url: `${api_name}/updatePasswod`,
            method: 'post',
            data: data
        })
    },
    updateInfo(data) {
        return request({
            url: `${api_name}/updateInfo`,
            method: 'post',
            data: data
        })
    },
    myInfo() {
        return request({
            url: `${api_name}/myInfo`,
            method: 'get'
        })
    },
    realNameAuthentication(data) {
        return request({
            url: `${api_name}/realNameAuthentication`,
            method: 'post',
            data: data
        })
    },
    getRealNameAuthenticationResult() {
        return request({
            url: `${api_name}/getRealNameAuthenticationResult`,
            method: 'get'
        })
    },
    queryIdentify(params) {
        return request({
            url: `${api_name}/queryIdentify`,
            method: 'get',
            params
        })
    },
    recommendList(params) {// 我的推荐列表
        return request({
            url: `${api_name}/list`,
            method: 'get',
            params: params
        })
    },
    recommendStatus() {// 获取推荐结果
        return request({
            url: `${api_name}/recommendStatus`,
            method: 'get',

        })
    },
    recommendRegistration(data) { // 推荐
        return request({
            url: `${api_name}/registration`,
            method: 'post',
            data: data
        })
    },
    updatePayment(data) { // 申请退会费
        return request({
            url: `/sx/userPayment/updatePayment`,
            method: 'post',
            data: data
        })
    },
    changeGroup(groupName) { // 更换小组名
        return request({
            url: `/sx/user/changeGroup?groupName=${groupName}`,
            method: 'post',
            data: groupName
        })
    },

    changeGroupStatus() { // 更换小组名
        return request({
            url: `/sx/user/changeGroupStatus`,
            method: 'get',
        })
    },


// 获取本月新增人数
    monInsertPersonNum() {
        return request({
            url: `${api_name}/getCurMonthInsertNum`,
            method: 'get'
        })
    },
// 获取当年每组每月新增人数
    curYearPerMonthPerGroupInsertNum() {
        return request({
            url: `${api_name}/getCurYearPerMonthPerGroupInsertNum`,
            method: 'get'
        })
    }
}
